import request from '@/utils/request'
import store from '../store'
export function fetchList(query) {
  return request({
    url: '/suppliesType/page',
    method: 'get',
    params: query
  })
}

export function delObj(id) {
  return request({
    url: '/suppliesType/del/' + id,
    method: 'get'
  })
}

export function getObj(id) {
  return request({
    url: '/suppliesType/get/' + id,
    method: 'get'
  })
}
export function putObj(obj) {
  return request({
    url: '/suppliesType/modify',
    method: 'post',
    data: obj
  })
}
export function addObj(obj) {
  return request({
    url: '/suppliesType/save',
    method: 'post',
    data: obj
  })
}
export async function uploadImg(fd) {
  return request({
    url: '/mall/ad/imgUpload',
    method: 'post',
    data: fd
  })
}

export function getToken() {
  return store.getters.token
}

